package com.chenshu.controller;

import com.chenshu.model.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;

import javax.annotation.Resource;
import java.io.PrintWriter;

/**
 * Created with IntelliJ IDEA
 * Description
 * User：chenshu
 * Date：2023-12-11
 * Time：19:30
 */
@Controller
public class UserController {

    //多个同种类型的bean对象
//    @Autowired
//    @Qualifier(value =  "stu_user2")
//    private User user;

    @Resource(name = "stu_user3")
    private User user;

    public void doController() {
        System.out.println("Do user controller");
        System.out.println(user.getName());
    }
}
